Object::DeepClone
Section: ET++ method description (n)
Updated: automatically Fri Mar 1 10:54:57 1991
Index
Return to Main Contents
NAME
Object::DeepClone - instance method
TEMPLATE
deepClone = ObjPtr
DeepClone()
SPECIFIERS
public
virtual
DESCRIPTION
Returns a deep copy of the receiver. In contrast to the method Clone, it recursively applies DeepClone for all
part objects of the receiver.
So the deepClone is a copy of the object graph originating in the
receiver. Note that a referenced object shall not be not necessarily
deep-cloned. This is the case, for example, if the referenced object is not
part of the receiver, but acquainted to it only. Acquainted objects are
objects providing some services, for instance. The deep-clone may either
share such an object with the source object, or may have set the
corresponding instance variable to nil.
The default implementation uses Object Input/Output to do the
job. Thus, it depends on the implementation of the method PrintOn
and the method ReadFrom. Except for objects that must not be
instantiated more than once (so-called atoms, like Styles for instance)
even if they are written or read via object i/o, there are no examples
in ET++ where the semantics of ReadFrom and PrintOn for a certain class
would be not appropriate for deep-cloning, too.
But it is not excluded (until proven the opposite), that such a difference
might be the case.
Doing Object I/O for atoms is extremely difficult in ET++ V2.2. In the
future, there will be support for that.
Because copying with Object I/O is rather slow, this method may be
overridden for small and less complex objects like it is done by the class ObjInt or the class BitSet.
Method is rarely overridden.
ARGUMENTS
none
RETURN ARGUMENT
- ObjPtr deepClone
-
a deep copy of the object
CATEGORIES
copying, client interface, overrider interface
FIRST DEFINITION
class Object
FILES
- implementation:
-
Object.C
Index
- NAME
-
- TEMPLATE
-
- SPECIFIERS
-
- DESCRIPTION
-
- ARGUMENTS
-
- RETURN ARGUMENT
-
- CATEGORIES
-
- FIRST DEFINITION
-
- FILES
-
This document was created by
man2html,
using the manual pages.
Time: 00:40:25 GMT, March 30, 2022